<?php
	$assessment_breadcrum = $ajax->link
	(
		'Assessment',
		array( 'controller' => 'questiongroups', 'action' => 'ajax_get', $assessment['Assessment']['id'] ),
		array( 'update' => 'edit_div_'.$assessment['Assessment']['id'], 'indicator' => 'loading')
	);
	
	$question_breadcrum = $ajax->link(
		'Questions',
		array( 'controller' => 'questions', 'action' => 'ajax_get', $questiongroup['Questiongroup']['id'] ),
		array( 'update' => 'edit_div_'.$assessment['Assessment']['id'], 'indicator' => 'loading')
	);
?>
<div id="whiteBG">
<div id="crumb"><ul>
	<li class="crumbMiddle" id="crumb01mid"><?php echo $assessment_breadcrum ?></li>
	<li class="crumbMiddle" id="crumb02on"><a href="#">Question Group</a></li>
	<li class="crumbMiddle" id="crumb03"><?php echo $question_breadcrum ?></li>
	<li class="crumbMiddle" id="crumb04">Question</li>
	<li class="crumbMiddle" id="crumb05">Answers</li>
	<li class="crumbMiddle" id="crumb06">Answer</li>
</ul></div> 

<div class="assessment">
	<div class="eTitle">
		<h2><?php 
				if(	strlen($questiongroup['Questiongroup']['name']) > 40)
					$questiongroup['Questiongroup']['name'] = substr($questiongroup['Questiongroup']['name'], 0, 40);
				
				echo $questiongroup['Questiongroup']['name'];
			?>
		</h2>
	</div>
	<div class="aToolbar">
		<span class="aToolbarButton">
			<span class="iconNew"></span>
			<?php
				echo $ajax->link(
					'Add Question',
					array( 'controller' => 'questions', 'action' => 'ajax_add', $questiongroup['Questiongroup']['id'] ),
					array( 'update' => 'edit_div_'.$assessment['Assessment']['id'], 'indicator' => 'loading')
				);
			?>
		</span>
		<span class="aToolbarButton">
			<span class="iconEdit"></span>
			<?php 
			echo $ajax->link(
				'Edit Questions',
				array( 'controller' => 'questions', 'action' => 'ajax_get', $questiongroup['Questiongroup']['id'] ),
				array( 'update' => 'edit_div_'.$assessment['Assessment']['id'], 'indicator' => 'loading')
			);
			?>
		</span>
		<span class="aToolbarButton">
			<span class="iconDelete"></span>
			<?php 
			echo $ajax->link(
				'Delete Question Group',
				array( 'controller' => 'questiongroups', 'action' => 'ajax_delete', $questiongroup['Questiongroup']['id'] ),
				array( 'update' => 'edit_div_'.$assessment['Assessment']['id'], 'indicator' => 'loading')
			);
			?>
		</span>
	</div>
	<?php
		echo $ajax->form(array('type' => 'post',
			'options' => array(
				'model'=>'Questiongroup',
				'update'=>'edit_div_'.$assessment['Assessment']['id'],
				'url' => array(
					'controller' => 'questiongroups',
					'action' => 'ajax_edit'
				),
			)
		));
		?>
	<div id="aForm">
		<div id="aFormLeft">

		<?php echo $form->hidden('id');?>
		<?php echo $form->input('name');?>
		<?php echo $form->input('action', array('label'=>'Action Name In World'));?>
		<?php #echo $form->input('number_correct_required');?>
		</div>
		<div id="aFormRight">
			<div>
			<?php echo $form->input('description');?>
			<?php echo $form->input('message_only');?>
			<?php #echo $form->input('random_order');?>
			</div>
			<div class="right">
				<?php echo $form->submit('Update');?>
				<div class="submit"><?php 
				echo $ajax->link
				(
					'Cancel',
					array( 'controller' => 'questiongroups', 'action' => 'ajax_get', $assessment['Assessment']['id'] ),
					array( 'update' => 'edit_div_'.$assessment['Assessment']['id'], 'indicator' => 'loading')
				); ?>&nbsp;&nbsp;
				<?php echo $form->end();?>
				<?php 
					if(isset($flash))
						print $session->flash(); 
					unset($flash);
				?>
				</div>
			</div>
		</div>
	</div>
</div>
</div>
